-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create CAST(item, type) function #2326
Conversation
AEsir777
commented
Nov 1, 2023
•
edited
Loading
edited
- add bind csv config
- add function CAST
944a80e
to
791d77b
Compare
e45a4e2
to
4575089
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2326 +/- ##
==========================================
+ Coverage 90.24% 90.26% +0.02%
==========================================
Files 1011 1011
Lines 32308 32344 +36
==========================================
+ Hits 29156 29195 +39
+ Misses 3152 3149 -3
☔ View full report in Codecov by Sentry. |
4575089
to
9d51ca5
Compare
832112e
to
3d082dc
Compare
0d05af0
to
d3a050c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, i will let @andyfengHKU comment on the match function. Seems we have a lot of if statement for cast functions in the binder.
if (execFunc != nullptr) { | ||
execFunc(parameters, *resultVector); | ||
execFunc(parameters, *resultVector, nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make the dataptr default type to null, so you don't need to pass in the nullptr there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
using scalar_exec_func = std::function<void( const std::vector<std::shared_ptr<common::ValueVector>>&, common::ValueVector&, void*)>;
specifies the function needs to take in 3 arguments, I still need to pass nullptr
.
d3a050c
to
0da2553
Compare
@@ -68,6 +68,9 @@ Function* BuiltInFunctions::matchScalarFunction( | |||
uint32_t minCost = UINT32_MAX; | |||
for (auto& function : functionSet) { | |||
auto func = reinterpret_cast<Function*>(function.get()); | |||
if (name == CAST_FUNC_NAME) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this. And inside bindScalarFunctionExpression
we check functionName == "Cast" and directly get the function without going through the the matchScalarFunction